package com.study.zzedu.bean;

import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.study.zzedu.widget.bean.TreeNode;
import com.study.zzedu.widget.bean.TreeViewBinder;
import com.study.zzedu.R;

/**
 * LeafViewBinder
 *
 * @author 林zero
 * @date 2018/1/17
 */

public class LeafGradeViewBinder extends TreeViewBinder<LeafGradeViewBinder.ViewHolder> {
    @Override
    public int getLayoutId() {
        return R.layout.item_leaf_grade;
    }

    @Override
    public int getToggleId() {
        return 0;
    }

    @Override
    public int getCheckedId() {
        return 0;
    }

    @Override
    public int getClickId() {
        return 0;
    }

    @Override
    public int getTypeId() {
        return 0;
    }

    @Override
    public ViewHolder creatViewHolder(View itemView) {
        return new ViewHolder(itemView);
    }

    @Override
    public void bindViewHolder(ViewHolder holder, int position, TreeNode treeNode) {
        ((TextView) holder.findViewById(R.id.tv_online)).setText(((LeafNodeGrade) treeNode.getValue()).getOnline());
        ((TextView) holder.findViewById(R.id.tv_test)).setText(((LeafNodeGrade) treeNode.getValue()).getTest());
        ((TextView) holder.findViewById(R.id.tv_end)).setText(((LeafNodeGrade) treeNode.getValue()).getEnd());
        ((TextView) holder.findViewById(R.id.tv_flag)).setText(((LeafNodeGrade) treeNode.getValue()).getFlag());
    }

    class ViewHolder extends TreeViewBinder.ViewHolder {
        public ViewHolder(View itemView) {
            super(itemView);
        }
    }
}
